package com.zj.osm.entity.db;

import java.util.List;
import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.internal.DaoConfig;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import org.greenrobot.greendao.query.Query;
import org.greenrobot.greendao.query.QueryBuilder;

import com.zj.osm.entity.greendao.Equipment;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/** 
 * DAO for table "EQUIPMENT".
*/
public class EquipmentDao extends AbstractDao<Equipment, Long> {

    public static final String TABLENAME = "EQUIPMENT";

    /**
     * Properties of entity Equipment.<br/>
     * Can be used for QueryBuilder and for referencing column names.
     */
    public static class Properties {
        public final static Property Id = new Property(0, Long.class, "id", true, "_id");
        public final static Property Name = new Property(1, String.class, "name", false, "NAME");
        public final static Property Name_before = new Property(2, String.class, "name_before", false, "NAME_BEFORE");
        public final static Property Angel = new Property(3, int.class, "angel", false, "ANGEL");
        public final static Property Angle_after = new Property(4, int.class, "angle_after", false, "ANGLE_AFTER");
        public final static Property EqupmentIcon = new Property(5, String.class, "equpmentIcon", false, "EQUPMENT_ICON");
        public final static Property EqupmentIcon_before = new Property(6, String.class, "equpmentIcon_before", false, "EQUPMENT_ICON_BEFORE");
        public final static Property Lever_id = new Property(7, String.class, "lever_id", false, "LEVER_ID");
        public final static Property Head_id = new Property(8, String.class, "head_id", false, "HEAD_ID");
        public final static Property Lever_id_before = new Property(9, String.class, "lever_id_before", false, "LEVER_ID_BEFORE");
        public final static Property Head_id_before = new Property(10, String.class, "head_id_before", false, "HEAD_ID_BEFORE");
        public final static Property EquipmentId = new Property(11, String.class, "equipmentId", false, "EQUIPMENT_ID");
        public final static Property LineId = new Property(12, Long.class, "lineId", false, "LINE_ID");
        public final static Property LineCid = new Property(13, String.class, "lineCid", false, "LINE_CID");
        public final static Property PointId = new Property(14, Long.class, "pointId", false, "POINT_ID");
        public final static Property Amount = new Property(15, int.class, "amount", false, "AMOUNT");
        public final static Property Amount_before = new Property(16, int.class, "amount_before", false, "AMOUNT_BEFORE");
        public final static Property OneName = new Property(17, String.class, "oneName", false, "ONE_NAME");
        public final static Property TwoName = new Property(18, String.class, "twoName", false, "TWO_NAME");
        public final static Property TowName_before = new Property(19, String.class, "towName_before", false, "TOW_NAME_BEFORE");
        public final static Property ThreeName = new Property(20, String.class, "threeName", false, "THREE_NAME");
        public final static Property ThreeName_before = new Property(21, String.class, "threeName_before", false, "THREE_NAME_BEFORE");
        public final static Property FourName = new Property(22, String.class, "fourName", false, "FOUR_NAME");
        public final static Property FourId = new Property(23, String.class, "fourId", false, "FOUR_ID");
        public final static Property FourId_before = new Property(24, String.class, "fourId_before", false, "FOUR_ID_BEFORE");
        public final static Property OneId = new Property(25, String.class, "oneId", false, "ONE_ID");
        public final static Property TwoId = new Property(26, String.class, "twoId", false, "TWO_ID");
        public final static Property ThreeId = new Property(27, String.class, "threeId", false, "THREE_ID");
        public final static Property ThreeId_before = new Property(28, String.class, "threeId_before", false, "THREE_ID_BEFORE");
        public final static Property ShaoJing = new Property(29, String.class, "shaoJing", false, "SHAO_JING");
        public final static Property Qubie = new Property(30, int.class, "qubie", false, "QUBIE");
        public final static Property Note = new Property(31, String.class, "note", false, "NOTE");
        public final static Property LineName = new Property(32, String.class, "lineName", false, "LINE_NAME");
        public final static Property ProjectId = new Property(33, Long.class, "projectId", false, "PROJECT_ID");
        public final static Property Module_code = new Property(34, String.class, "module_code", false, "MODULE_CODE");
        public final static Property Module_code_before = new Property(35, String.class, "module_code_before", false, "MODULE_CODE_BEFORE");
        public final static Property ModuleID = new Property(36, String.class, "ModuleID", false, "MODULE_ID");
        public final static Property ModuleID_before = new Property(37, String.class, "ModuleID_before", false, "MODULE_ID_BEFORE");
        public final static Property GetModuleTypeID = new Property(38, String.class, "getModuleTypeID", false, "GET_MODULE_TYPE_ID");
        public final static Property ModuleTxt = new Property(39, String.class, "ModuleTxt", false, "MODULE_TXT");
        public final static Property Statu = new Property(40, String.class, "Statu", false, "STATU");
        public final static Property Statu_before = new Property(41, String.class, "Statu_before", false, "STATU_BEFORE");
        public final static Property EqupmentNumber = new Property(42, String.class, "equpmentNumber", false, "EQUPMENT_NUMBER");
        public final static Property EqupmentNumber_after = new Property(43, String.class, "equpmentNumber_after", false, "EQUPMENT_NUMBER_AFTER");
        public final static Property PoleHeight = new Property(44, String.class, "poleHeight", false, "POLE_HEIGHT");
        public final static Property PoleHeight_before = new Property(45, String.class, "poleHeight_before", false, "POLE_HEIGHT_BEFORE");
        public final static Property StrengthLevel = new Property(46, String.class, "strengthLevel", false, "STRENGTH_LEVEL");
        public final static Property StrengthLevel_before = new Property(47, String.class, "strengthLevel_before", false, "STRENGTH_LEVEL_BEFORE");
        public final static Property VoltageLevel = new Property(48, String.class, "voltageLevel", false, "VOLTAGE_LEVEL");
        public final static Property VoltageLevel_befo = new Property(49, String.class, "voltageLevel_befo", false, "VOLTAGE_LEVEL_BEFO");
        public final static Property Loop = new Property(50, String.class, "loop", false, "LOOP");
        public final static Property Loop_before = new Property(51, String.class, "loop_before", false, "LOOP_BEFORE");
        public final static Property JdModleCode = new Property(52, String.class, "JdModleCode", false, "JD_MODLE_CODE");
        public final static Property JdModleCode_before = new Property(53, String.class, "JdModleCode_before", false, "JD_MODLE_CODE_BEFORE");
        public final static Property Capacitance = new Property(54, String.class, "capacitance", false, "CAPACITANCE");
        public final static Property Capacitance_before = new Property(55, String.class, "capacitance_before", false, "CAPACITANCE_BEFORE");
        public final static Property CompleteSet = new Property(56, String.class, "completeSet", false, "COMPLETE_SET");
        public final static Property CompleteSet_before = new Property(57, String.class, "completeSet_before", false, "COMPLETE_SET_BEFORE");
        public final static Property RodType = new Property(58, String.class, "rodType", false, "ROD_TYPE");
        public final static Property RodType_before = new Property(59, String.class, "rodType_before", false, "ROD_TYPE_BEFORE");
        public final static Property RodCategory = new Property(60, String.class, "rodCategory", false, "ROD_CATEGORY");
        public final static Property RodCategory_before = new Property(61, String.class, "rodCategory_before", false, "ROD_CATEGORY_BEFORE");
    }

    private Query<Equipment> line_EquipmentListQuery;
    private Query<Equipment> point_EquipmentListQuery;

    public EquipmentDao(DaoConfig config) {
        super(config);
    }
    
    public EquipmentDao(DaoConfig config, DaoSession daoSession) {
        super(config, daoSession);
    }

    /** Creates the underlying database table. */
    public static void createTable(Database db, boolean ifNotExists) {
        String constraint = ifNotExists? "IF NOT EXISTS ": "";
        db.execSQL("CREATE TABLE " + constraint + "\"EQUIPMENT\" (" + //
                "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
                "\"NAME\" TEXT," + // 1: name
                "\"NAME_BEFORE\" TEXT," + // 2: name_before
                "\"ANGEL\" INTEGER NOT NULL ," + // 3: angel
                "\"ANGLE_AFTER\" INTEGER NOT NULL ," + // 4: angle_after
                "\"EQUPMENT_ICON\" TEXT," + // 5: equpmentIcon
                "\"EQUPMENT_ICON_BEFORE\" TEXT," + // 6: equpmentIcon_before
                "\"LEVER_ID\" TEXT," + // 7: lever_id
                "\"HEAD_ID\" TEXT," + // 8: head_id
                "\"LEVER_ID_BEFORE\" TEXT," + // 9: lever_id_before
                "\"HEAD_ID_BEFORE\" TEXT," + // 10: head_id_before
                "\"EQUIPMENT_ID\" TEXT," + // 11: equipmentId
                "\"LINE_ID\" INTEGER," + // 12: lineId
                "\"LINE_CID\" TEXT," + // 13: lineCid
                "\"POINT_ID\" INTEGER," + // 14: pointId
                "\"AMOUNT\" INTEGER NOT NULL ," + // 15: amount
                "\"AMOUNT_BEFORE\" INTEGER NOT NULL ," + // 16: amount_before
                "\"ONE_NAME\" TEXT," + // 17: oneName
                "\"TWO_NAME\" TEXT," + // 18: twoName
                "\"TOW_NAME_BEFORE\" TEXT," + // 19: towName_before
                "\"THREE_NAME\" TEXT," + // 20: threeName
                "\"THREE_NAME_BEFORE\" TEXT," + // 21: threeName_before
                "\"FOUR_NAME\" TEXT," + // 22: fourName
                "\"FOUR_ID\" TEXT," + // 23: fourId
                "\"FOUR_ID_BEFORE\" TEXT," + // 24: fourId_before
                "\"ONE_ID\" TEXT," + // 25: oneId
                "\"TWO_ID\" TEXT," + // 26: twoId
                "\"THREE_ID\" TEXT," + // 27: threeId
                "\"THREE_ID_BEFORE\" TEXT," + // 28: threeId_before
                "\"SHAO_JING\" TEXT," + // 29: shaoJing
                "\"QUBIE\" INTEGER NOT NULL ," + // 30: qubie
                "\"NOTE\" TEXT," + // 31: note
                "\"LINE_NAME\" TEXT," + // 32: lineName
                "\"PROJECT_ID\" INTEGER," + // 33: projectId
                "\"MODULE_CODE\" TEXT," + // 34: module_code
                "\"MODULE_CODE_BEFORE\" TEXT," + // 35: module_code_before
                "\"MODULE_ID\" TEXT," + // 36: ModuleID
                "\"MODULE_ID_BEFORE\" TEXT," + // 37: ModuleID_before
                "\"GET_MODULE_TYPE_ID\" TEXT," + // 38: getModuleTypeID
                "\"MODULE_TXT\" TEXT," + // 39: ModuleTxt
                "\"STATU\" TEXT," + // 40: Statu
                "\"STATU_BEFORE\" TEXT," + // 41: Statu_before
                "\"EQUPMENT_NUMBER\" TEXT," + // 42: equpmentNumber
                "\"EQUPMENT_NUMBER_AFTER\" TEXT," + // 43: equpmentNumber_after
                "\"POLE_HEIGHT\" TEXT," + // 44: poleHeight
                "\"POLE_HEIGHT_BEFORE\" TEXT," + // 45: poleHeight_before
                "\"STRENGTH_LEVEL\" TEXT," + // 46: strengthLevel
                "\"STRENGTH_LEVEL_BEFORE\" TEXT," + // 47: strengthLevel_before
                "\"VOLTAGE_LEVEL\" TEXT," + // 48: voltageLevel
                "\"VOLTAGE_LEVEL_BEFO\" TEXT," + // 49: voltageLevel_befo
                "\"LOOP\" TEXT," + // 50: loop
                "\"LOOP_BEFORE\" TEXT," + // 51: loop_before
                "\"JD_MODLE_CODE\" TEXT," + // 52: JdModleCode
                "\"JD_MODLE_CODE_BEFORE\" TEXT," + // 53: JdModleCode_before
                "\"CAPACITANCE\" TEXT," + // 54: capacitance
                "\"CAPACITANCE_BEFORE\" TEXT," + // 55: capacitance_before
                "\"COMPLETE_SET\" TEXT," + // 56: completeSet
                "\"COMPLETE_SET_BEFORE\" TEXT," + // 57: completeSet_before
                "\"ROD_TYPE\" TEXT," + // 58: rodType
                "\"ROD_TYPE_BEFORE\" TEXT," + // 59: rodType_before
                "\"ROD_CATEGORY\" TEXT," + // 60: rodCategory
                "\"ROD_CATEGORY_BEFORE\" TEXT);"); // 61: rodCategory_before
        // Add Indexes
        db.execSQL("CREATE UNIQUE INDEX " + constraint + "IDX_EQUIPMENT_EQUIPMENT_ID ON \"EQUIPMENT\"" +
                " (\"EQUIPMENT_ID\" ASC);");
    }

    /** Drops the underlying database table. */
    public static void dropTable(Database db, boolean ifExists) {
        String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"EQUIPMENT\"";
        db.execSQL(sql);
    }

    @Override
    protected final void bindValues(DatabaseStatement stmt, Equipment entity) {
        stmt.clearBindings();
 
        Long id = entity.getId();
        if (id != null) {
            stmt.bindLong(1, id);
        }
 
        String name = entity.getName();
        if (name != null) {
            stmt.bindString(2, name);
        }
 
        String name_before = entity.getName_before();
        if (name_before != null) {
            stmt.bindString(3, name_before);
        }
        stmt.bindLong(4, entity.getAngel());
        stmt.bindLong(5, entity.getAngle_after());
 
        String equpmentIcon = entity.getEqupmentIcon();
        if (equpmentIcon != null) {
            stmt.bindString(6, equpmentIcon);
        }
 
        String equpmentIcon_before = entity.getEqupmentIcon_before();
        if (equpmentIcon_before != null) {
            stmt.bindString(7, equpmentIcon_before);
        }
 
        String lever_id = entity.getLever_id();
        if (lever_id != null) {
            stmt.bindString(8, lever_id);
        }
 
        String head_id = entity.getHead_id();
        if (head_id != null) {
            stmt.bindString(9, head_id);
        }
 
        String lever_id_before = entity.getLever_id_before();
        if (lever_id_before != null) {
            stmt.bindString(10, lever_id_before);
        }
 
        String head_id_before = entity.getHead_id_before();
        if (head_id_before != null) {
            stmt.bindString(11, head_id_before);
        }
 
        String equipmentId = entity.getEquipmentId();
        if (equipmentId != null) {
            stmt.bindString(12, equipmentId);
        }
 
        Long lineId = entity.getLineId();
        if (lineId != null) {
            stmt.bindLong(13, lineId);
        }
 
        String lineCid = entity.getLineCid();
        if (lineCid != null) {
            stmt.bindString(14, lineCid);
        }
 
        Long pointId = entity.getPointId();
        if (pointId != null) {
            stmt.bindLong(15, pointId);
        }
        stmt.bindLong(16, entity.getAmount());
        stmt.bindLong(17, entity.getAmount_before());
 
        String oneName = entity.getOneName();
        if (oneName != null) {
            stmt.bindString(18, oneName);
        }
 
        String twoName = entity.getTwoName();
        if (twoName != null) {
            stmt.bindString(19, twoName);
        }
 
        String towName_before = entity.getTowName_before();
        if (towName_before != null) {
            stmt.bindString(20, towName_before);
        }
 
        String threeName = entity.getThreeName();
        if (threeName != null) {
            stmt.bindString(21, threeName);
        }
 
        String threeName_before = entity.getThreeName_before();
        if (threeName_before != null) {
            stmt.bindString(22, threeName_before);
        }
 
        String fourName = entity.getFourName();
        if (fourName != null) {
            stmt.bindString(23, fourName);
        }
 
        String fourId = entity.getFourId();
        if (fourId != null) {
            stmt.bindString(24, fourId);
        }
 
        String fourId_before = entity.getFourId_before();
        if (fourId_before != null) {
            stmt.bindString(25, fourId_before);
        }
 
        String oneId = entity.getOneId();
        if (oneId != null) {
            stmt.bindString(26, oneId);
        }
 
        String twoId = entity.getTwoId();
        if (twoId != null) {
            stmt.bindString(27, twoId);
        }
 
        String threeId = entity.getThreeId();
        if (threeId != null) {
            stmt.bindString(28, threeId);
        }
 
        String threeId_before = entity.getThreeId_before();
        if (threeId_before != null) {
            stmt.bindString(29, threeId_before);
        }
 
        String shaoJing = entity.getShaoJing();
        if (shaoJing != null) {
            stmt.bindString(30, shaoJing);
        }
        stmt.bindLong(31, entity.getQubie());
 
        String note = entity.getNote();
        if (note != null) {
            stmt.bindString(32, note);
        }
 
        String lineName = entity.getLineName();
        if (lineName != null) {
            stmt.bindString(33, lineName);
        }
 
        Long projectId = entity.getProjectId();
        if (projectId != null) {
            stmt.bindLong(34, projectId);
        }
 
        String module_code = entity.getModule_code();
        if (module_code != null) {
            stmt.bindString(35, module_code);
        }
 
        String module_code_before = entity.getModule_code_before();
        if (module_code_before != null) {
            stmt.bindString(36, module_code_before);
        }
 
        String ModuleID = entity.getModuleID();
        if (ModuleID != null) {
            stmt.bindString(37, ModuleID);
        }
 
        String ModuleID_before = entity.getModuleID_before();
        if (ModuleID_before != null) {
            stmt.bindString(38, ModuleID_before);
        }
 
        String getModuleTypeID = entity.getGetModuleTypeID();
        if (getModuleTypeID != null) {
            stmt.bindString(39, getModuleTypeID);
        }
 
        String ModuleTxt = entity.getModuleTxt();
        if (ModuleTxt != null) {
            stmt.bindString(40, ModuleTxt);
        }
 
        String Statu = entity.getStatu();
        if (Statu != null) {
            stmt.bindString(41, Statu);
        }
 
        String Statu_before = entity.getStatu_before();
        if (Statu_before != null) {
            stmt.bindString(42, Statu_before);
        }
 
        String equpmentNumber = entity.getEqupmentNumber();
        if (equpmentNumber != null) {
            stmt.bindString(43, equpmentNumber);
        }
 
        String equpmentNumber_after = entity.getEqupmentNumber_after();
        if (equpmentNumber_after != null) {
            stmt.bindString(44, equpmentNumber_after);
        }
 
        String poleHeight = entity.getPoleHeight();
        if (poleHeight != null) {
            stmt.bindString(45, poleHeight);
        }
 
        String poleHeight_before = entity.getPoleHeight_before();
        if (poleHeight_before != null) {
            stmt.bindString(46, poleHeight_before);
        }
 
        String strengthLevel = entity.getStrengthLevel();
        if (strengthLevel != null) {
            stmt.bindString(47, strengthLevel);
        }
 
        String strengthLevel_before = entity.getStrengthLevel_before();
        if (strengthLevel_before != null) {
            stmt.bindString(48, strengthLevel_before);
        }
 
        String voltageLevel = entity.getVoltageLevel();
        if (voltageLevel != null) {
            stmt.bindString(49, voltageLevel);
        }
 
        String voltageLevel_befo = entity.getVoltageLevel_befo();
        if (voltageLevel_befo != null) {
            stmt.bindString(50, voltageLevel_befo);
        }
 
        String loop = entity.getLoop();
        if (loop != null) {
            stmt.bindString(51, loop);
        }
 
        String loop_before = entity.getLoop_before();
        if (loop_before != null) {
            stmt.bindString(52, loop_before);
        }
 
        String JdModleCode = entity.getJdModleCode();
        if (JdModleCode != null) {
            stmt.bindString(53, JdModleCode);
        }
 
        String JdModleCode_before = entity.getJdModleCode_before();
        if (JdModleCode_before != null) {
            stmt.bindString(54, JdModleCode_before);
        }
 
        String capacitance = entity.getCapacitance();
        if (capacitance != null) {
            stmt.bindString(55, capacitance);
        }
 
        String capacitance_before = entity.getCapacitance_before();
        if (capacitance_before != null) {
            stmt.bindString(56, capacitance_before);
        }
 
        String completeSet = entity.getCompleteSet();
        if (completeSet != null) {
            stmt.bindString(57, completeSet);
        }
 
        String completeSet_before = entity.getCompleteSet_before();
        if (completeSet_before != null) {
            stmt.bindString(58, completeSet_before);
        }
 
        String rodType = entity.getRodType();
        if (rodType != null) {
            stmt.bindString(59, rodType);
        }
 
        String rodType_before = entity.getRodType_before();
        if (rodType_before != null) {
            stmt.bindString(60, rodType_before);
        }
 
        String rodCategory = entity.getRodCategory();
        if (rodCategory != null) {
            stmt.bindString(61, rodCategory);
        }
 
        String rodCategory_before = entity.getRodCategory_before();
        if (rodCategory_before != null) {
            stmt.bindString(62, rodCategory_before);
        }
    }

    @Override
    protected final void bindValues(SQLiteStatement stmt, Equipment entity) {
        stmt.clearBindings();
 
        Long id = entity.getId();
        if (id != null) {
            stmt.bindLong(1, id);
        }
 
        String name = entity.getName();
        if (name != null) {
            stmt.bindString(2, name);
        }
 
        String name_before = entity.getName_before();
        if (name_before != null) {
            stmt.bindString(3, name_before);
        }
        stmt.bindLong(4, entity.getAngel());
        stmt.bindLong(5, entity.getAngle_after());
 
        String equpmentIcon = entity.getEqupmentIcon();
        if (equpmentIcon != null) {
            stmt.bindString(6, equpmentIcon);
        }
 
        String equpmentIcon_before = entity.getEqupmentIcon_before();
        if (equpmentIcon_before != null) {
            stmt.bindString(7, equpmentIcon_before);
        }
 
        String lever_id = entity.getLever_id();
        if (lever_id != null) {
            stmt.bindString(8, lever_id);
        }
 
        String head_id = entity.getHead_id();
        if (head_id != null) {
            stmt.bindString(9, head_id);
        }
 
        String lever_id_before = entity.getLever_id_before();
        if (lever_id_before != null) {
            stmt.bindString(10, lever_id_before);
        }
 
        String head_id_before = entity.getHead_id_before();
        if (head_id_before != null) {
            stmt.bindString(11, head_id_before);
        }
 
        String equipmentId = entity.getEquipmentId();
        if (equipmentId != null) {
            stmt.bindString(12, equipmentId);
        }
 
        Long lineId = entity.getLineId();
        if (lineId != null) {
            stmt.bindLong(13, lineId);
        }
 
        String lineCid = entity.getLineCid();
        if (lineCid != null) {
            stmt.bindString(14, lineCid);
        }
 
        Long pointId = entity.getPointId();
        if (pointId != null) {
            stmt.bindLong(15, pointId);
        }
        stmt.bindLong(16, entity.getAmount());
        stmt.bindLong(17, entity.getAmount_before());
 
        String oneName = entity.getOneName();
        if (oneName != null) {
            stmt.bindString(18, oneName);
        }
 
        String twoName = entity.getTwoName();
        if (twoName != null) {
            stmt.bindString(19, twoName);
        }
 
        String towName_before = entity.getTowName_before();
        if (towName_before != null) {
            stmt.bindString(20, towName_before);
        }
 
        String threeName = entity.getThreeName();
        if (threeName != null) {
            stmt.bindString(21, threeName);
        }
 
        String threeName_before = entity.getThreeName_before();
        if (threeName_before != null) {
            stmt.bindString(22, threeName_before);
        }
 
        String fourName = entity.getFourName();
        if (fourName != null) {
            stmt.bindString(23, fourName);
        }
 
        String fourId = entity.getFourId();
        if (fourId != null) {
            stmt.bindString(24, fourId);
        }
 
        String fourId_before = entity.getFourId_before();
        if (fourId_before != null) {
            stmt.bindString(25, fourId_before);
        }
 
        String oneId = entity.getOneId();
        if (oneId != null) {
            stmt.bindString(26, oneId);
        }
 
        String twoId = entity.getTwoId();
        if (twoId != null) {
            stmt.bindString(27, twoId);
        }
 
        String threeId = entity.getThreeId();
        if (threeId != null) {
            stmt.bindString(28, threeId);
        }
 
        String threeId_before = entity.getThreeId_before();
        if (threeId_before != null) {
            stmt.bindString(29, threeId_before);
        }
 
        String shaoJing = entity.getShaoJing();
        if (shaoJing != null) {
            stmt.bindString(30, shaoJing);
        }
        stmt.bindLong(31, entity.getQubie());
 
        String note = entity.getNote();
        if (note != null) {
            stmt.bindString(32, note);
        }
 
        String lineName = entity.getLineName();
        if (lineName != null) {
            stmt.bindString(33, lineName);
        }
 
        Long projectId = entity.getProjectId();
        if (projectId != null) {
            stmt.bindLong(34, projectId);
        }
 
        String module_code = entity.getModule_code();
        if (module_code != null) {
            stmt.bindString(35, module_code);
        }
 
        String module_code_before = entity.getModule_code_before();
        if (module_code_before != null) {
            stmt.bindString(36, module_code_before);
        }
 
        String ModuleID = entity.getModuleID();
        if (ModuleID != null) {
            stmt.bindString(37, ModuleID);
        }
 
        String ModuleID_before = entity.getModuleID_before();
        if (ModuleID_before != null) {
            stmt.bindString(38, ModuleID_before);
        }
 
        String getModuleTypeID = entity.getGetModuleTypeID();
        if (getModuleTypeID != null) {
            stmt.bindString(39, getModuleTypeID);
        }
 
        String ModuleTxt = entity.getModuleTxt();
        if (ModuleTxt != null) {
            stmt.bindString(40, ModuleTxt);
        }
 
        String Statu = entity.getStatu();
        if (Statu != null) {
            stmt.bindString(41, Statu);
        }
 
        String Statu_before = entity.getStatu_before();
        if (Statu_before != null) {
            stmt.bindString(42, Statu_before);
        }
 
        String equpmentNumber = entity.getEqupmentNumber();
        if (equpmentNumber != null) {
            stmt.bindString(43, equpmentNumber);
        }
 
        String equpmentNumber_after = entity.getEqupmentNumber_after();
        if (equpmentNumber_after != null) {
            stmt.bindString(44, equpmentNumber_after);
        }
 
        String poleHeight = entity.getPoleHeight();
        if (poleHeight != null) {
            stmt.bindString(45, poleHeight);
        }
 
        String poleHeight_before = entity.getPoleHeight_before();
        if (poleHeight_before != null) {
            stmt.bindString(46, poleHeight_before);
        }
 
        String strengthLevel = entity.getStrengthLevel();
        if (strengthLevel != null) {
            stmt.bindString(47, strengthLevel);
        }
 
        String strengthLevel_before = entity.getStrengthLevel_before();
        if (strengthLevel_before != null) {
            stmt.bindString(48, strengthLevel_before);
        }
 
        String voltageLevel = entity.getVoltageLevel();
        if (voltageLevel != null) {
            stmt.bindString(49, voltageLevel);
        }
 
        String voltageLevel_befo = entity.getVoltageLevel_befo();
        if (voltageLevel_befo != null) {
            stmt.bindString(50, voltageLevel_befo);
        }
 
        String loop = entity.getLoop();
        if (loop != null) {
            stmt.bindString(51, loop);
        }
 
        String loop_before = entity.getLoop_before();
        if (loop_before != null) {
            stmt.bindString(52, loop_before);
        }
 
        String JdModleCode = entity.getJdModleCode();
        if (JdModleCode != null) {
            stmt.bindString(53, JdModleCode);
        }
 
        String JdModleCode_before = entity.getJdModleCode_before();
        if (JdModleCode_before != null) {
            stmt.bindString(54, JdModleCode_before);
        }
 
        String capacitance = entity.getCapacitance();
        if (capacitance != null) {
            stmt.bindString(55, capacitance);
        }
 
        String capacitance_before = entity.getCapacitance_before();
        if (capacitance_before != null) {
            stmt.bindString(56, capacitance_before);
        }
 
        String completeSet = entity.getCompleteSet();
        if (completeSet != null) {
            stmt.bindString(57, completeSet);
        }
 
        String completeSet_before = entity.getCompleteSet_before();
        if (completeSet_before != null) {
            stmt.bindString(58, completeSet_before);
        }
 
        String rodType = entity.getRodType();
        if (rodType != null) {
            stmt.bindString(59, rodType);
        }
 
        String rodType_before = entity.getRodType_before();
        if (rodType_before != null) {
            stmt.bindString(60, rodType_before);
        }
 
        String rodCategory = entity.getRodCategory();
        if (rodCategory != null) {
            stmt.bindString(61, rodCategory);
        }
 
        String rodCategory_before = entity.getRodCategory_before();
        if (rodCategory_before != null) {
            stmt.bindString(62, rodCategory_before);
        }
    }

    @Override
    public Long readKey(Cursor cursor, int offset) {
        return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
    }    

    @Override
    public Equipment readEntity(Cursor cursor, int offset) {
        Equipment entity = new Equipment( //
            cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
            cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // name
            cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name_before
            cursor.getInt(offset + 3), // angel
            cursor.getInt(offset + 4), // angle_after
            cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // equpmentIcon
            cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // equpmentIcon_before
            cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lever_id
            cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // head_id
            cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // lever_id_before
            cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // head_id_before
            cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // equipmentId
            cursor.isNull(offset + 12) ? null : cursor.getLong(offset + 12), // lineId
            cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // lineCid
            cursor.isNull(offset + 14) ? null : cursor.getLong(offset + 14), // pointId
            cursor.getInt(offset + 15), // amount
            cursor.getInt(offset + 16), // amount_before
            cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // oneName
            cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // twoName
            cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // towName_before
            cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // threeName
            cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // threeName_before
            cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // fourName
            cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // fourId
            cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // fourId_before
            cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // oneId
            cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26), // twoId
            cursor.isNull(offset + 27) ? null : cursor.getString(offset + 27), // threeId
            cursor.isNull(offset + 28) ? null : cursor.getString(offset + 28), // threeId_before
            cursor.isNull(offset + 29) ? null : cursor.getString(offset + 29), // shaoJing
            cursor.getInt(offset + 30), // qubie
            cursor.isNull(offset + 31) ? null : cursor.getString(offset + 31), // note
            cursor.isNull(offset + 32) ? null : cursor.getString(offset + 32), // lineName
            cursor.isNull(offset + 33) ? null : cursor.getLong(offset + 33), // projectId
            cursor.isNull(offset + 34) ? null : cursor.getString(offset + 34), // module_code
            cursor.isNull(offset + 35) ? null : cursor.getString(offset + 35), // module_code_before
            cursor.isNull(offset + 36) ? null : cursor.getString(offset + 36), // ModuleID
            cursor.isNull(offset + 37) ? null : cursor.getString(offset + 37), // ModuleID_before
            cursor.isNull(offset + 38) ? null : cursor.getString(offset + 38), // getModuleTypeID
            cursor.isNull(offset + 39) ? null : cursor.getString(offset + 39), // ModuleTxt
            cursor.isNull(offset + 40) ? null : cursor.getString(offset + 40), // Statu
            cursor.isNull(offset + 41) ? null : cursor.getString(offset + 41), // Statu_before
            cursor.isNull(offset + 42) ? null : cursor.getString(offset + 42), // equpmentNumber
            cursor.isNull(offset + 43) ? null : cursor.getString(offset + 43), // equpmentNumber_after
            cursor.isNull(offset + 44) ? null : cursor.getString(offset + 44), // poleHeight
            cursor.isNull(offset + 45) ? null : cursor.getString(offset + 45), // poleHeight_before
            cursor.isNull(offset + 46) ? null : cursor.getString(offset + 46), // strengthLevel
            cursor.isNull(offset + 47) ? null : cursor.getString(offset + 47), // strengthLevel_before
            cursor.isNull(offset + 48) ? null : cursor.getString(offset + 48), // voltageLevel
            cursor.isNull(offset + 49) ? null : cursor.getString(offset + 49), // voltageLevel_befo
            cursor.isNull(offset + 50) ? null : cursor.getString(offset + 50), // loop
            cursor.isNull(offset + 51) ? null : cursor.getString(offset + 51), // loop_before
            cursor.isNull(offset + 52) ? null : cursor.getString(offset + 52), // JdModleCode
            cursor.isNull(offset + 53) ? null : cursor.getString(offset + 53), // JdModleCode_before
            cursor.isNull(offset + 54) ? null : cursor.getString(offset + 54), // capacitance
            cursor.isNull(offset + 55) ? null : cursor.getString(offset + 55), // capacitance_before
            cursor.isNull(offset + 56) ? null : cursor.getString(offset + 56), // completeSet
            cursor.isNull(offset + 57) ? null : cursor.getString(offset + 57), // completeSet_before
            cursor.isNull(offset + 58) ? null : cursor.getString(offset + 58), // rodType
            cursor.isNull(offset + 59) ? null : cursor.getString(offset + 59), // rodType_before
            cursor.isNull(offset + 60) ? null : cursor.getString(offset + 60), // rodCategory
            cursor.isNull(offset + 61) ? null : cursor.getString(offset + 61) // rodCategory_before
        );
        return entity;
    }
     
    @Override
    public void readEntity(Cursor cursor, Equipment entity, int offset) {
        entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
        entity.setName(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
        entity.setName_before(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
        entity.setAngel(cursor.getInt(offset + 3));
        entity.setAngle_after(cursor.getInt(offset + 4));
        entity.setEqupmentIcon(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
        entity.setEqupmentIcon_before(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
        entity.setLever_id(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
        entity.setHead_id(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
        entity.setLever_id_before(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
        entity.setHead_id_before(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
        entity.setEquipmentId(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
        entity.setLineId(cursor.isNull(offset + 12) ? null : cursor.getLong(offset + 12));
        entity.setLineCid(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13));
        entity.setPointId(cursor.isNull(offset + 14) ? null : cursor.getLong(offset + 14));
        entity.setAmount(cursor.getInt(offset + 15));
        entity.setAmount_before(cursor.getInt(offset + 16));
        entity.setOneName(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17));
        entity.setTwoName(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18));
        entity.setTowName_before(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19));
        entity.setThreeName(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20));
        entity.setThreeName_before(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21));
        entity.setFourName(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22));
        entity.setFourId(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23));
        entity.setFourId_before(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24));
        entity.setOneId(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25));
        entity.setTwoId(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26));
        entity.setThreeId(cursor.isNull(offset + 27) ? null : cursor.getString(offset + 27));
        entity.setThreeId_before(cursor.isNull(offset + 28) ? null : cursor.getString(offset + 28));
        entity.setShaoJing(cursor.isNull(offset + 29) ? null : cursor.getString(offset + 29));
        entity.setQubie(cursor.getInt(offset + 30));
        entity.setNote(cursor.isNull(offset + 31) ? null : cursor.getString(offset + 31));
        entity.setLineName(cursor.isNull(offset + 32) ? null : cursor.getString(offset + 32));
        entity.setProjectId(cursor.isNull(offset + 33) ? null : cursor.getLong(offset + 33));
        entity.setModule_code(cursor.isNull(offset + 34) ? null : cursor.getString(offset + 34));
        entity.setModule_code_before(cursor.isNull(offset + 35) ? null : cursor.getString(offset + 35));
        entity.setModuleID(cursor.isNull(offset + 36) ? null : cursor.getString(offset + 36));
        entity.setModuleID_before(cursor.isNull(offset + 37) ? null : cursor.getString(offset + 37));
        entity.setGetModuleTypeID(cursor.isNull(offset + 38) ? null : cursor.getString(offset + 38));
        entity.setModuleTxt(cursor.isNull(offset + 39) ? null : cursor.getString(offset + 39));
        entity.setStatu(cursor.isNull(offset + 40) ? null : cursor.getString(offset + 40));
        entity.setStatu_before(cursor.isNull(offset + 41) ? null : cursor.getString(offset + 41));
        entity.setEqupmentNumber(cursor.isNull(offset + 42) ? null : cursor.getString(offset + 42));
        entity.setEqupmentNumber_after(cursor.isNull(offset + 43) ? null : cursor.getString(offset + 43));
        entity.setPoleHeight(cursor.isNull(offset + 44) ? null : cursor.getString(offset + 44));
        entity.setPoleHeight_before(cursor.isNull(offset + 45) ? null : cursor.getString(offset + 45));
        entity.setStrengthLevel(cursor.isNull(offset + 46) ? null : cursor.getString(offset + 46));
        entity.setStrengthLevel_before(cursor.isNull(offset + 47) ? null : cursor.getString(offset + 47));
        entity.setVoltageLevel(cursor.isNull(offset + 48) ? null : cursor.getString(offset + 48));
        entity.setVoltageLevel_befo(cursor.isNull(offset + 49) ? null : cursor.getString(offset + 49));
        entity.setLoop(cursor.isNull(offset + 50) ? null : cursor.getString(offset + 50));
        entity.setLoop_before(cursor.isNull(offset + 51) ? null : cursor.getString(offset + 51));
        entity.setJdModleCode(cursor.isNull(offset + 52) ? null : cursor.getString(offset + 52));
        entity.setJdModleCode_before(cursor.isNull(offset + 53) ? null : cursor.getString(offset + 53));
        entity.setCapacitance(cursor.isNull(offset + 54) ? null : cursor.getString(offset + 54));
        entity.setCapacitance_before(cursor.isNull(offset + 55) ? null : cursor.getString(offset + 55));
        entity.setCompleteSet(cursor.isNull(offset + 56) ? null : cursor.getString(offset + 56));
        entity.setCompleteSet_before(cursor.isNull(offset + 57) ? null : cursor.getString(offset + 57));
        entity.setRodType(cursor.isNull(offset + 58) ? null : cursor.getString(offset + 58));
        entity.setRodType_before(cursor.isNull(offset + 59) ? null : cursor.getString(offset + 59));
        entity.setRodCategory(cursor.isNull(offset + 60) ? null : cursor.getString(offset + 60));
        entity.setRodCategory_before(cursor.isNull(offset + 61) ? null : cursor.getString(offset + 61));
     }
    
    @Override
    protected final Long updateKeyAfterInsert(Equipment entity, long rowId) {
        entity.setId(rowId);
        return rowId;
    }
    
    @Override
    public Long getKey(Equipment entity) {
        if(entity != null) {
            return entity.getId();
        } else {
            return null;
        }
    }

    @Override
    public boolean hasKey(Equipment entity) {
        return entity.getId() != null;
    }

    @Override
    protected final boolean isEntityUpdateable() {
        return true;
    }
    
    /** Internal query to resolve the "equipmentList" to-many relationship of Line. */
    public List<Equipment> _queryLine_EquipmentList(Long lineId) {
        synchronized (this) {
            if (line_EquipmentListQuery == null) {
                QueryBuilder<Equipment> queryBuilder = queryBuilder();
                queryBuilder.where(Properties.LineId.eq(null));
                line_EquipmentListQuery = queryBuilder.build();
            }
        }
        Query<Equipment> query = line_EquipmentListQuery.forCurrentThread();
        query.setParameter(0, lineId);
        return query.list();
    }

    /** Internal query to resolve the "equipmentList" to-many relationship of Point. */
    public List<Equipment> _queryPoint_EquipmentList(Long pointId) {
        synchronized (this) {
            if (point_EquipmentListQuery == null) {
                QueryBuilder<Equipment> queryBuilder = queryBuilder();
                queryBuilder.where(Properties.PointId.eq(null));
                point_EquipmentListQuery = queryBuilder.build();
            }
        }
        Query<Equipment> query = point_EquipmentListQuery.forCurrentThread();
        query.setParameter(0, pointId);
        return query.list();
    }

}
